/*
 * Rectangle.cpp
 *
 *  Created on: 2012/07/04
 *      Author: weihe
 */

#include "Rectangle.h"

namespace geom {

void Rectangle::createInside(Rectangle outter, float aspect) {
	float outterAspect = outter.aspect();
	if (outterAspect < aspect) {
		width = outter.width;
		height = width / aspect;
	} else {
		height = outter.height;
		width = height * aspect;
	}
	center(outter.center());
}

} /* namespace geom */
